import math
import numpy as np
import matplotlib.pyplot as plt
import csv


SS = []
EE = []
II = []
RR = []
Theta = []


def readFile2List(csv_file_name):
    with open(csv_file_name, 'r') as f:
        S = []
        E = []
        I = []
        R = []
        T = []
        reader = csv.reader(f, delimiter=',', quoting=csv.QUOTE_NONE)
        for row in reader:
            #print(row)
            if row[0].isalpha() :
                #print(row[0])
                continue
            S.append(row[0])
            E.append(row[1])
            I.append(row[2])
            R.append(row[3])
            T.append(row[4])
        SS.append(S)
        EE.append(E)
        II.append(I)
        RR.append(R)
        Theta.append(T)

readFile2List('test_m_1.csv')
readFile2List('test_m_3.csv')
readFile2List('test_m_5.csv')
readFile2List('test_m_7.csv')
print(SS)

def Show(listData, lbl):
    li = list(map(float, listData))
    #print(li)
    plt.plot(range(0,len(li)), li, label=lbl)


def ShowListList(lldata, fid):
    plt.figure(fid)
    Show(lldata[0], 'm=1')
    Show(lldata[1], 'm=3')
    Show(lldata[2], 'm=5')
    Show(lldata[3], 'm=7')
    plt.legend()

#ShowListList(SS, 'S')
#ShowListList(EE, 'E')
#ShowListList(II, 'I')
#ShowListList(RR, 'R')
ShowListList(Theta,'Theta')


plt.show()

